package com.zhang.es.test;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;

import java.io.IOException;

/**
 * @ClassName ElasticSearch_Client
 * @Description es高级客户端
 * @Author zhanghongguo
 * @Date 2021/12/17 10:46
 * @Version 1.0
 */
public class ElasticSearch_Client {
    public static void main(String[] args) throws IOException {
        //创建客户端
        RestHighLevelClient client = new RestHighLevelClient(RestClient.builder(new HttpHost("192.168.56.10",9200,"http")));
        //关闭客户端
        client.close();
    }
}
